|
Sansa Framework is a structure to create PHP web applications using the MVC model, it's a web application that must be installed in a server to work, could be installed in a test server or in production server. The developer must create a data model and do all the changes the project need and at any time generate the model. The generation creates a Database in Mysql server with the same name of the model and a n-tier layer of libraries to handle the Db. To insert a new record to the table, create a new instance of a class, fill the properties and call the insert method. $usr = new users(); $usr->name = "test"; $usr->insert(); The code above insert one record to the table users with the name test. $usr = new users(); if($usr->get("name")->where("id=1")->exe()) } The code above print test. $usr = new users(1); echo $usr->name; The code above print test too. Complex code: public function save($arr) } return $result; } The code below shows how to create joins. require($_SERVER() . '/layers/bll/users.php'); require($_SERVER() . '/layers/bll/rights.php'); require($_SERVER() . '/layers/bll/access.php'); $u = new users(); if($u->join($r = new rights())->on(array($u->rightid(), EQUAL, $r->id())) ->join($a = new access())->on(array($r->idaccess(), EQUAL, $a->aid())) ->get(array($u->name(), $r->rname(), $a->aname())) ->exe()) ==External links== * (The Sansa Framework website ) 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Sansa Framework」の詳細全文を読む スポンサード リンク
|